package com.ltkj.shop.domain.vo;

import com.ltkj.common.core.utils.bean.BeanUtils;
import com.ltkj.shop.domain.ShopRestaurant;
import com.ltkj.system.api.domain.ShopRestaurantDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.compress.utils.Lists;

import java.util.List;

/**
 * 餐饮商户对象 shop_restaurant
 *
 * @author xupf
 * @date 2023-09-04
 */
@ApiModel(value = "餐饮商户")
@Data
public class ShopRestaurantVo extends ShopRestaurant
{
    private static final long serialVersionUID = 1L;

    /** 轮播图 */
    @ApiModelProperty(value = "轮播图")
    private List<ShopImgVo> imgDetails = Lists.newArrayList();

    /** 菜单列表 */
    @ApiModelProperty(value = "菜单列表")
    private List<ShopRestMenuVo> restMenuVos;

    /** 缩略图类型（移动端首页使用） */
    @ApiModelProperty(value = "缩略图类型")
    private String fileType = "0";

    /** 缩略图地址（移动端首页使用） */
    @ApiModelProperty(value = "缩略图地址")
    private String imgPath;

    /** 移动端首页使用 */
    @ApiModelProperty(value = "title")
    private String title;

    /** 移动端首页使用 */
    @ApiModelProperty(value = "tabType")
    private String tabType = "4";

    public String getTitle() {
        return getName();
    }

    public String getImgPath() {
        return getImgAbbrev();
    }

    public static ShopRestaurantDTO toDTO(ShopRestaurantVo vo) {
        ShopRestaurantDTO shopRestaurantDTO = new ShopRestaurantDTO();
        BeanUtils.copyBeanProp(shopRestaurantDTO, vo);
        return shopRestaurantDTO;
    }
}
